package com.hsurosy.infrastructure.persistent.dao;

import com.hsurosy.infrastructure.persistent.po.Strategy;
import com.hsurosy.infrastructure.persistent.po.StrategyRule;
import org.apache.ibatis.annotations.Mapper;

import java.util.List;

/**
 * @Author Hsu琛君珩
 * @Date 2024-10-14 18:58
 * @Description 抽奖策略规则 DAO
 * @Version: v1.0.0
 */
@Mapper
public interface IStrategyRuleDao {

    /**
     * 获取所有抽奖策略规则的列表
     *
     * @return
     * StrategyRule(1L, 100001L, 101, 2, "rule_random", "1,1000", "随机积分策略", ...)
     * StrategyRule(2L, 100001L, 107, 2, "rule_lock", "1", "抽奖1次后解锁", ...)
     * StrategyRule(3L, 100002L, 108, 2, "rule_luck_award", "1,100", "兜底奖品100积分内", ...)
     */
    List<StrategyRule> queryStrategyRuleList();

    /**
     * 根据传入的 StrategyRule 对象信息查询匹配的具体规则
     *
     * @param strategyRuleReq StrategyRule 对象
     * @return StrategyRule(1L, 100001L, 101, 2, "rule_random", "1,1000", "随机积分策略", ...)
     */
    StrategyRule queryStrategyRule(StrategyRule strategyRuleReq);

    /**
     * 根据传入的 StrategyRule 对象获取其对应的 rule_value 字段值
     *
     * @param strategyRule StrategyRule 对象
     * @return "1"
     */
    String queryStrategyRuleValue(StrategyRule strategyRule);

}
